<template>
  <div>
    <div class="top_btn" @click="changeLangEvent">中文</div>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  methods: {
    changeLangEvent() {
      console.log("changeLangEvent");
      if (this.$i18n.locale === "zh-CN") {
        this.$i18n.locale = "en-US"; //关键语句
        console.log("en-US");
      } else {
        this.$i18n.locale = "zh-CN"; //关键语句
        console.log("zh-CN");
      }
    },
  },
};
</script>